/**
 * Author(s): xuming.Wong <xuming.Wong@gmail.com>
 */
#ifndef __MAP_DBC_H__
#define __MAP_DBC_H__

#include "WOWDbcFile.h"

namespace PQGame
{
	class MapInfo
	{
	public:
		int Id;
		std::string Name;
		std::string Description;

		MapInfo()
		{
			Id=0;
			Name="";
			Description="";
		}

		MapInfo(int id,std::string name,std::string description)
		{
			Id=id;
			Name=name;
			Description=description;
		}
	};

	typedef std::vector<MapInfo> MapInfoVector;

	class MapDbc
	{
	public:
		static const std::string PATH;
	protected:
		MapDbc();
	public:
		static MapDbc& getSingleton()
		{
			static MapDbc inst;
			return inst;
		}

		inline int getRecordCount()
		{
			return _dbc->getRecordCount();
		}

		inline MapInfo getMapInfo(int index)
		{
			return _infos[index];
		}

		inline int getMapCount()
		{
			return _infos.size();
		}

	private:
		void init();
	private:
		WOWDbcFile* _dbc;
		MapInfoVector _infos;
	};
}

#define SMapDbc PQGame::MapDbc::getSingleton()

#endif
